ostree.git
4 years ago.lgtm.yml: Fix gpgme dependency
Dan Nicholson [Thu, 17 Feb 2022 17:13:03 +0000 (10:13 -0700)]
.lgtm.yml: Fix gpgme dependency

Since Ubuntu 18.04, libgpgme-dev is the real package and libgpgme11-dev
is a virtual package provided by it. Apparently LGTM running on Ubuntu
20.04 no longer resolves the virtual package:

```
WARNING: Package 'libgpgme11-dev' requested by configuration file was not found
```

That ends up causing the build to fail:

```
configure: error: Need GPGME_PTHREAD version 1.1.8 or later
```

4 years agoMerge pull request #2542 from cgwalters/tar-error-prefixing
Colin Walters [Tue, 15 Feb 2022 23:22:01 +0000 (18:22 -0500)]
Merge pull request #2542 from cgwalters/tar-error-prefixing

lib/tar: Add some error prefixing

4 years agolib/tar: Add some error prefixing
Colin Walters [Tue, 15 Feb 2022 19:17:20 +0000 (14:17 -0500)]
lib/tar: Add some error prefixing

We're trying to debug a problem with a tar stream with hardlinks,
and I think this will be helpful.

4 years agoMerge pull request #2541 from melix99/find-remotes-fix-typo
Colin Walters [Sun, 13 Feb 2022 15:54:30 +0000 (10:54 -0500)]
Merge pull request #2541 from melix99/find-remotes-fix-typo

man: Fix typo in ostree-find-remotes

4 years agoMerge pull request #2540 from melix99/switch-fix-typo
Colin Walters [Sun, 13 Feb 2022 15:53:33 +0000 (10:53 -0500)]
Merge pull request #2540 from melix99/switch-fix-typo

man: Fix typo in ostree-admin-switch

4 years agoman: Fix typo in ostree-find-remotes
Marco Melorio [Sat, 12 Feb 2022 18:00:28 +0000 (19:00 +0100)]
man: Fix typo in ostree-find-remotes

4 years agoman: Fix typo in ostree-admin-switch
Marco Melorio [Sat, 12 Feb 2022 17:48:35 +0000 (18:48 +0100)]
man: Fix typo in ostree-admin-switch

4 years agoMerge pull request #2539 from chergert/main
Colin Walters [Sat, 12 Feb 2022 14:04:43 +0000 (09:04 -0500)]
Merge pull request #2539 from chergert/main

lib/bootloader: use ot_journal_print() instead of sd-journal

4 years agolib/bootloader: use ot_journal_print() instead of sd-journal
Christian Hergert [Fri, 11 Feb 2022 23:12:15 +0000 (15:12 -0800)]
lib/bootloader: use ot_journal_print() instead of sd-journal

This needs to use the helper so that USE_LIBSYSTEMD still works as
expected.

4 years agolib/util: add syslog.h for ot_journal_print()
Christian Hergert [Fri, 11 Feb 2022 22:31:12 +0000 (14:31 -0800)]
lib/util: add syslog.h for ot_journal_print()

If we aren't including sd-journal, we may need this too.

4 years agoMerge pull request #2538 from cgwalters/dirmeta-not-floating
Colin Walters [Fri, 11 Feb 2022 23:01:49 +0000 (18:01 -0500)]
Merge pull request #2538 from cgwalters/dirmeta-not-floating

core: Mark `ostree_create_directory_metadata` as `(not nullable)`

4 years agoMerge pull request #2491 from nikita-dubrovskii/secure-execution
Colin Walters [Fri, 11 Feb 2022 20:34:55 +0000 (15:34 -0500)]
Merge pull request #2491 from nikita-dubrovskii/secure-execution

s390x: add secure-execution support

4 years agocore: Mark `ostree_create_directory_metadata` as `(not nullable)`
Colin Walters [Fri, 11 Feb 2022 19:09:49 +0000 (14:09 -0500)]
core: Mark `ostree_create_directory_metadata` as `(not nullable)`

So I can drop an unnecessary use of `unwrap()` in Rust.

4 years agos390x: add LUKS keyfile to 'sd-boot'
Nikita Dubrovskii [Mon, 17 Jan 2022 14:59:54 +0000 (15:59 +0100)]
s390x: add LUKS keyfile to 'sd-boot'

This allows to use Secure Execution with LUKS encrypted boot disk,
key and cryptab are stored only in 'sd-boot' encrypted image.

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
4 years agos390x: add "IBM Secure Execution for Linux" support
Nikita Dubrovskii [Wed, 17 Nov 2021 12:10:20 +0000 (13:10 +0100)]
s390x: add "IBM Secure Execution for Linux" support

If system contains ibm-z-hostkey (fetched during ignition), than
ostree generates 'sd-boot' image and reboots into Secure Execution

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
4 years agoMerge pull request #2537 from jlebon/pr/fix-floating
Colin Walters [Wed, 9 Feb 2022 22:15:26 +0000 (17:15 -0500)]
Merge pull request #2537 from jlebon/pr/fix-floating

lib/gpg-verify-result: Add missing floating annotation

4 years agolib/gpg-verify-result: Add missing floating annotation
Jonathan Lebon [Wed, 9 Feb 2022 19:29:50 +0000 (14:29 -0500)]
lib/gpg-verify-result: Add missing floating annotation

I think I'm hitting issues due to this while using the Rust bindings:
https://github.com/coreos/rpm-ostree/pull/3406#issuecomment-1033084956

The bindings for those APIs use `from_glib_full` which says:

> Because ownership can only be transferred if something is already
> referenced, this is unsuitable for floating references.

4 years agoMerge pull request #2535 from dbnicholson/summary-commit-version
Colin Walters [Fri, 4 Feb 2022 22:51:02 +0000 (17:51 -0500)]
Merge pull request #2535 from dbnicholson/summary-commit-version

lib/repo: Add commit version metadata to summary metadata

4 years agolib/repo: Add commit version metadata to summary metadata
Dan Nicholson [Fri, 4 Feb 2022 21:11:06 +0000 (14:11 -0700)]
lib/repo: Add commit version metadata to summary metadata

The commit metadata `version` key is well established but getting it for
a remote commit is cumbersome since the commit object needs to be
fetched and loaded. Including it in the summary additional metadata
allows a much more convenient view of what each of the remote refs
represents.

4 years agoMerge pull request #2534 from jlebon/pr/copr
Jonathan Lebon [Thu, 3 Feb 2022 20:36:50 +0000 (15:36 -0500)]
Merge pull request #2534 from jlebon/pr/copr

4 years agoAdd COPR integration Makefile
Jonathan Lebon [Thu, 3 Feb 2022 18:25:07 +0000 (13:25 -0500)]
Add COPR integration Makefile

I'd like to enable auto-builds of this repo to
https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/ so it could
eventually feed into
https://github.com/coreos/fedora-coreos-tracker/issues/910.

4 years agoci/make-git-snapshot.sh: xz the archive
Jonathan Lebon [Thu, 3 Feb 2022 18:23:43 +0000 (13:23 -0500)]
ci/make-git-snapshot.sh: xz the archive

This matches `make dist` and what the spec file expects.

4 years agoci/make-git-snapshot.sh: auto-initialize submodules
Jonathan Lebon [Thu, 3 Feb 2022 18:22:47 +0000 (13:22 -0500)]
ci/make-git-snapshot.sh: auto-initialize submodules

Matches `autogen.sh`.

4 years agoci/make-git-snapshot.sh: fix archive name
Jonathan Lebon [Thu, 3 Feb 2022 18:21:54 +0000 (13:21 -0500)]
ci/make-git-snapshot.sh: fix archive name

The archive name is libostree even though the project name is ostree, so
we can't rely on the directory name.

Just hardcode it.

4 years agoci/libbuild.sh: drop yum/CentOS support
Jonathan Lebon [Thu, 3 Feb 2022 18:08:22 +0000 (13:08 -0500)]
ci/libbuild.sh: drop yum/CentOS support

`dnf` is present in all the platforms we care about now, and the CentOS
bit is out of date. We can re-add it if we add e.g. C[89]S support with
the updated list of packages.

Motivated by noticing that the `yum` symlink isn't always present.

4 years agoMerge pull request #2533 from lucab/ups/commit-cleanup-assertions
Jonathan Lebon [Tue, 1 Feb 2022 18:57:00 +0000 (13:57 -0500)]
Merge pull request #2533 from lucab/ups/commit-cleanup-assertions

4 years agolib/commit: clean up assertions
Luca BRUNO [Tue, 1 Feb 2022 17:33:28 +0000 (17:33 +0000)]
lib/commit: clean up assertions

This aligns all the assertion in the module. In particular, it gets
rid of all `g_return_val_if_fail` instances which may fail without
properly setting GError to the caller.

4 years agoMerge pull request #2530 from smcv/update-libglnx-2525
Colin Walters [Sat, 29 Jan 2022 15:19:24 +0000 (10:19 -0500)]
Merge pull request #2530 from smcv/update-libglnx-2525

Update libglnx submodule

4 years agoUpdate submodule: libglnx
Simon McVittie [Fri, 28 Jan 2022 12:20:39 +0000 (12:20 +0000)]
Update submodule: libglnx

Resolves: https://gitlab.gnome.org/GNOME/libglnx/-/issues/3
Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agoMerge pull request #2529 from smcv/static-delta-error-unwind
Colin Walters [Fri, 28 Jan 2022 14:22:27 +0000 (09:22 -0500)]
Merge pull request #2529 from smcv/static-delta-error-unwind

libotutil: Avoid infinite recursion during error unwinding

4 years agolibotutil: Avoid infinite recursion during error unwinding
Simon McVittie [Fri, 28 Jan 2022 11:08:00 +0000 (11:08 +0000)]
libotutil: Avoid infinite recursion during error unwinding

When we clean up from an error, for example copy_file_range() failing
while we generate a static delta (perhaps caused by
https://gitlab.gnome.org/GNOME/libglnx/-/issues/3 or by a
genuine write error), we might free a variant builder that has a
non-null parent. Previously, this caused infinite recursion and a stack
overflow, repeatedly freeing the same object, but Luca Bruno suggested
that the intention here appears to have been to free the parent object.

Partially resolves https://github.com/ostreedev/ostree/issues/2525
(the other bug reported in that issue needs to be resolved by updating
libglnx to a version where libglnx#3 has been fixed).

Signed-off-by: Simon McVittie <smcv@collabora.com>
4 years agoMerge pull request #2524 from jlebon/pr/unlink-lock
Luca Bruno [Wed, 26 Jan 2022 08:36:45 +0000 (08:36 +0000)]
Merge pull request #2524 from jlebon/pr/unlink-lock

lib/deploy: When deleting staged deployment, delete any lock

4 years agotests/kolainst: Avoid recursive symlinks
Jonathan Lebon [Fri, 21 Jan 2022 18:41:32 +0000 (13:41 -0500)]
tests/kolainst: Avoid recursive symlinks

`kola` now follows symlinks when archiving an external test's `data/`
dir. So the recursive `data` symlink we have here breaks it.

Let's just move the shared files in its own directory and update the
symlinks.

4 years agoMerge pull request #2526 from lucab/ups/openat-load-xattrs
Colin Walters [Tue, 25 Jan 2022 10:59:58 +0000 (05:59 -0500)]
Merge pull request #2526 from lucab/ups/openat-load-xattrs

lib/repo: open file only if required

4 years agolib/repo: open file only if required
Luca BRUNO [Mon, 24 Jan 2022 16:46:40 +0000 (16:46 +0000)]
lib/repo: open file only if required

This tightens up the logic for opening a file while inspecting its
xattrs. The only codepath fetching xattrs from a FD is the one
handling 'bare' mode.
It also rearranges the else-assert flow, mostly for future-proofing.

4 years agoostree/deploy: Test finalization locking
Jonathan Lebon [Fri, 21 Jan 2022 18:47:02 +0000 (13:47 -0500)]
ostree/deploy: Test finalization locking

Support for that file was added previously, but the testing lived in
rpm-ostree only. Let's add it here too.

In the process add a hidden `--lock-finalization` to `ostree admin
deploy` to make testing easier (though it could also be useful to update
managers driving OSTree via the CLI).

4 years agolib/deploy: When deleting staged deployment, delete any lock
Jonathan Lebon [Fri, 21 Jan 2022 16:28:25 +0000 (11:28 -0500)]
lib/deploy: When deleting staged deployment, delete any lock

Otherwise, any future staged deployment will also automatically be
locked even if not requested. Likely we should fold the locking into the
primary `staged-deployment` serialized GVariant instead.

4 years agoMerge pull request #2523 from lucab/ups/ls-gcancellable-gerror
Joseph Marrero Corchado [Fri, 21 Jan 2022 13:30:00 +0000 (08:30 -0500)]
Merge pull request #2523 from lucab/ups/ls-gcancellable-gerror

builtin: use GCancellable and GError everywhere

4 years agobuiltin: use GCancellable and GError everywhere
Luca BRUNO [Fri, 21 Jan 2022 12:26:32 +0000 (12:26 +0000)]
builtin: use GCancellable and GError everywhere

This reworks `ostree ls` top-level logic so that cancellation
tokens and error details are plumbed through all codepaths.
It also gets rid of all previous goto jumps.

4 years agoMerge pull request #2521 from cgwalters/syncfs-only-log
Luca Bruno [Thu, 20 Jan 2022 16:58:05 +0000 (16:58 +0000)]
Merge pull request #2521 from cgwalters/syncfs-only-log

deploy: Also log to journal if we time out global sync()

4 years agodeploy: Also log to journal if we time out global sync()
Colin Walters [Thu, 20 Jan 2022 15:50:07 +0000 (10:50 -0500)]
deploy: Also log to journal if we time out global sync()

We do implicitly have this data because we log timings via structured
metadata in a later journal entry, but it's quite common to lose
the structured metadata because a lot of tooling just grabs the default
syslog-compatible text from `journalctl`.

Let's be louder when we hit this case as a general rule too; I think
most people shipping ostree systems want to see if it's happening.

4 years agoMerge pull request #2520 from lucab/ups/builtin-commit-reject-empty-metadata
Colin Walters [Thu, 20 Jan 2022 14:04:34 +0000 (09:04 -0500)]
Merge pull request #2520 from lucab/ups/builtin-commit-reject-empty-metadata

lib/commit: reject empty metadata keys

4 years agolib/commit: reject empty metadata keys
Luca BRUNO [Thu, 20 Jan 2022 10:54:30 +0000 (10:54 +0000)]
lib/commit: reject empty metadata keys

This adds one more check to the metadata validation logic in order
to reject empty metadata keys.

4 years agolib/commit: always validate metadata
Luca BRUNO [Wed, 19 Jan 2022 13:44:10 +0000 (13:44 +0000)]
lib/commit: always validate metadata

This tweaks commit logic in order to always validate metadata,
including on commits where the expected checksum is already known.

4 years agoMerge pull request #2519 from cgwalters/syncfs-only
Colin Walters [Tue, 18 Jan 2022 17:39:32 +0000 (12:39 -0500)]
Merge pull request #2519 from cgwalters/syncfs-only

deploy: Add a 5s max timeout on global filesystem `sync()`

4 years agodeploy: Add a 5s max timeout on global filesystem `sync()`
Colin Walters [Mon, 17 Jan 2022 16:46:04 +0000 (11:46 -0500)]
deploy: Add a 5s max timeout on global filesystem `sync()`

https://bugzilla.redhat.com/show_bug.cgi?id=2003532

Basically there's a systemd bug where it's losing the `_netdev`
aspect of Ceph filesystem mounts.  This means the network is taken
down before Ceph is unmounted.  In turn, our invocation of `sync()`
blocks on Ceph, which won't succeed.

And this in turn manifests as a failure to transition to the new
deployment.

I initially did this patch to just rip out the global `sync()`.  I
am pretty sure we don't need it anymore.  We've been doing individual
`syncfs()` on `/sysroot` and `/boot` for a while now, and those
are the only filesystems we should be touching.  But *proving* that
is a whole other thing of course.

To be conservative, let's instead just add a timeout of 5s on
our invocation of `sync()`.  It doesn't return any information on
success/error anyways.

To allow testing without the `sync()` invocation, we also support
a new `OSTREE_SYSROOT_OPT_SKIP_SYNC=1` environment variable.  For
staged deployments, this needs to be injected via e.g. systemd unit
overrides into `ostree-finalize-staged.service`.

Implementing this is a bit hairy - we need to spawn a thread.  I
debated blocking in arecursive mainloop, but I think `g_cond_wait_until()`
is also fine here.

4 years agoMerge pull request #2517 from dbnicholson/ubuntu-seccomp
Colin Walters [Thu, 13 Jan 2022 14:50:19 +0000 (09:50 -0500)]
Merge pull request #2517 from dbnicholson/ubuntu-seccomp

github: Workaround glib/seccomp issue on Ubuntu impish

4 years agogithub: Workaround glib/seccomp issue on Ubuntu impish
Dan Nicholson [Thu, 13 Jan 2022 00:10:56 +0000 (17:10 -0700)]
github: Workaround glib/seccomp issue on Ubuntu impish

The ubuntu-latest VMs are currently based on 20.04 (focal). In focal,
libseccomp2 doesn't know about the close_range syscall[1], but
g_spawn_sync in impish tries to use close_range since it's defined in
glibc. That causes libseccomp2 to return EPERM as it does for any
unknown syscalls. g_spawn_sync carries on silently instead of falling
back to other means of setting CLOEXEC on open FDs. Eventually it causes
some tests to hang since once side of a pipe is never closed. Remove
this when libseccomp2 in focal is updated or glib in impish handles the
EPERM better.

1. https://bugs.launchpad.net/ubuntu/+source/libseccomp/+bug/1944436

Fixes: #2495
4 years agoMerge pull request #2516 from cgwalters/define-ostree-booted
Jonathan Lebon [Wed, 12 Jan 2022 18:39:59 +0000 (13:39 -0500)]
Merge pull request #2516 from cgwalters/define-ostree-booted

4 years agosysroot: Add a public `#define OSTREE_PATH_BOOTED`
Colin Walters [Wed, 12 Jan 2022 17:47:11 +0000 (12:47 -0500)]
sysroot: Add a public `#define OSTREE_PATH_BOOTED`

This is public API.  Motivated by
https://github.com/coreos/rpm-ostree/pull/3325/files#diff-56528694f6f3213d6fb88d872f77291412dceec263b57166519843b13eca9a4dR30

4 years agoMerge pull request #2514 from lucab/ups/drop-setenv
Colin Walters [Wed, 12 Jan 2022 11:51:14 +0000 (06:51 -0500)]
Merge pull request #2514 from lucab/ups/drop-setenv

libostree/sepolicy: get rid of a g_setenv() call

4 years agoMerge pull request #2515 from cgwalters/cliwrap-lib
Joseph Marrero Corchado [Wed, 12 Jan 2022 02:01:20 +0000 (21:01 -0500)]
Merge pull request #2515 from cgwalters/cliwrap-lib

main: Also support CLI extensions in `/usr/libexec/libostree/ext`

4 years agomain: Also support CLI extensions in `/usr/libexec/libostree/ext`
Colin Walters [Tue, 11 Jan 2022 21:46:49 +0000 (16:46 -0500)]
main: Also support CLI extensions in `/usr/libexec/libostree/ext`

In fixing https://github.com/coreos/rpm-ostree/pull/3323
I felt that it was a bit ugly we're installing `/usr/bin/ostree-container`.

It's kind of an implementation detail.  We want users to use
`ostree container`.

Let's support values outside of $PATH too.

For example, this also ensures that TAB completion for `ost` expands
to `ostree ` with a space.

4 years agolibostree/sepolicy: get rid of a g_setenv() call
Luca BRUNO [Tue, 11 Jan 2022 15:39:30 +0000 (15:39 +0000)]
libostree/sepolicy: get rid of a g_setenv() call

This removes a 'g_setenv()' call, which could potentially be unsafe
in a multi-thread context.
The current libselinux codebase does not seem to check for
`LIBSELINUX_DISABLE_PCRE_PRECOMPILED`, so I think this has no effects
nowadays.
Additionally, I could not find any reference to it in libselinux
git history, so I'm not sure if it ever played any role at all.

My current understanding is that this is coming from version
incompatibilities between an older libselinux in the build environment
and a newer policy (with precompiled regexs) in the target.
But from the ML discussion I found, I think it eventually got
solved in a different way, possibly by avoiding the policy binary
caches.

Refs:
 * https://www.spinics.net/lists/selinux/msg14822.html
 * https://github.com/ostreedev/ostree/pull/2513#discussion_r781042884

4 years agoMerge pull request #2513 from lucab/ups/setenv-error
Luca Bruno [Mon, 10 Jan 2022 17:38:50 +0000 (17:38 +0000)]
Merge pull request #2513 from lucab/ups/setenv-error

ostree: check g_setenv return value

4 years agoostree: check g_setenv return value
Luca BRUNO [Mon, 10 Jan 2022 10:22:28 +0000 (10:22 +0000)]
ostree: check g_setenv return value

This adds proper return-value checks on g_setenv calls.
It fixes a static analysis warning highlighted by Coverity.

4 years agoMerge pull request #2512 from lucab/ups/variant-builder-error-memleak
Luca Bruno [Mon, 10 Jan 2022 13:32:25 +0000 (13:32 +0000)]
Merge pull request #2512 from lucab/ups/variant-builder-error-memleak

libotutil: avoid leaking builder memory on error

4 years agolibotutil: avoid leaking builder memory on error
Luca BRUNO [Mon, 10 Jan 2022 09:30:11 +0000 (09:30 +0000)]
libotutil: avoid leaking builder memory on error

This swaps the order of a couple of input sanity checks, in order
to fix a minor memory leak due to an early-return on the error
path.
Memory for the result is now allocated only after input has been
sanity-checked.
It fixes a static analysis warning highlighted by Coverity.

4 years agoMerge pull request #2509 from ostreedev/release-2022.1
Luca Bruno [Wed, 5 Jan 2022 14:32:55 +0000 (14:32 +0000)]
Merge pull request #2509 from ostreedev/release-2022.1

Release 2022.1

4 years agoconfigure: post-release version bump
Luca BRUNO [Wed, 5 Jan 2022 10:03:59 +0000 (10:03 +0000)]
configure: post-release version bump

4 years agoRelease 2022.1
Luca BRUNO [Wed, 5 Jan 2022 10:03:03 +0000 (10:03 +0000)]
Release 2022.1

4 years agoMerge pull request #2506 from lucab/ups/dependabot-config
Dan Nicholson [Tue, 4 Jan 2022 13:17:08 +0000 (06:17 -0700)]
Merge pull request #2506 from lucab/ups/dependabot-config

github: add dependabot config

4 years agogithub: add dependabot config
Luca BRUNO [Tue, 4 Jan 2022 10:30:20 +0000 (10:30 +0000)]
github: add dependabot config

This adds a configuration file for dependabot, taking care of automatic
updates for all git submodules.

4 years agoMerge pull request #2376 from smcv/fuse3
Luca Bruno [Tue, 4 Jan 2022 10:27:14 +0000 (10:27 +0000)]
Merge pull request #2376 from smcv/fuse3

rofiles-fuse: Build using FUSE 3 if possible, falling back to FUSE 2

4 years agorofiles-fuse: Build using FUSE 3 if possible, falling back to FUSE 2
Simon McVittie [Tue, 4 Jan 2022 09:41:38 +0000 (09:41 +0000)]
rofiles-fuse: Build using FUSE 3 if possible, falling back to FUSE 2

This adds build-time configuration logic to automatically detect
and switch between libfuse 2.x and 3.x.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Luca BRUNO <luca.bruno@coreos.com>
4 years agoMerge pull request #2505 from lucab/ups/bsdiff-error-throw
Colin Walters [Mon, 3 Jan 2022 21:57:52 +0000 (16:57 -0500)]
Merge pull request #2505 from lucab/ups/bsdiff-error-throw

lib/static-delta: throw a proper error on bspatch failure

4 years agoMerge pull request #2504 from lucab/ups/bsdiff-CVE-2014-9862
Colin Walters [Mon, 3 Jan 2022 18:20:55 +0000 (13:20 -0500)]
Merge pull request #2504 from lucab/ups/bsdiff-CVE-2014-9862

bsdiff: bump submodule, pick up fix for CVE-2014-9862

4 years agolib/static-delta: throw a proper error on bspatch failure
Luca BRUNO [Mon, 3 Jan 2022 17:38:51 +0000 (17:38 +0000)]
lib/static-delta: throw a proper error on bspatch failure

This makes sure that a populated GError is returned when bsdiff
patching fails. The human-friendly label also helps in debugging.

4 years agobsdiff: bump submodule, pick up fix for CVE-2014-9862
Luca BRUNO [Mon, 3 Jan 2022 15:42:50 +0000 (15:42 +0000)]
bsdiff: bump submodule, pick up fix for CVE-2014-9862

This updates the bsdiff submodule to latest upstream revision, in
order to pick up additional bound checks for CVE-2014-9862.

Update submodule: bsdiff
Ref:
 * https://www.x41-dsec.de/lab/advisories/x41-2020-006-bspatch/

4 years agoMerge pull request #2503 from lucab/ups/libostree-content-writer-header
Colin Walters [Mon, 3 Jan 2022 15:14:48 +0000 (10:14 -0500)]
Merge pull request #2503 from lucab/ups/libostree-content-writer-header

lib: use ostree-content-writer header

4 years agolib: use ostree-content-writer header
Luca BRUNO [Mon, 3 Jan 2022 14:20:58 +0000 (14:20 +0000)]
lib: use ostree-content-writer header

This installs and exposes the content of `ostree-content-writer.h`,
so that library consumers can properly reference symbols defined
in that header.

4 years agoMerge pull request #2502 from cgwalters/analyzer
Dan Nicholson [Tue, 21 Dec 2021 23:03:45 +0000 (16:03 -0700)]
Merge pull request #2502 from cgwalters/analyzer

two minor clang-analyzer fixes

4 years agotests: Fix clang-analyzer not seeing through `g_error()`
Colin Walters [Tue, 21 Dec 2021 19:24:03 +0000 (14:24 -0500)]
tests: Fix clang-analyzer not seeing through `g_error()`

Basically due to the glib structured logging rework we lost the
`noreturn` attribute on `g_error()`.
This is fixed in glib as of https://gitlab.gnome.org/GNOME/glib/-/commit/f97ff20adf4eb7b952dd83e2c13046fe9e282f50

But we might as well just throw an error here.

4 years agosoup-uri: Fix clang-analyzer warning by dropping dead code
Colin Walters [Tue, 21 Dec 2021 19:23:12 +0000 (14:23 -0500)]
soup-uri: Fix clang-analyzer warning by dropping dead code

Fixes `Argument with 'nonnull' attribute passed null` by making
the code not exist at all anymore.

In upstream libsoup this code is gone too; it uses `GUri` from glib
which we probably could now too, but one thing at a time.

4 years agoMerge pull request #2501 from lucab/ups/test-cli-extensions-tweak
Luca Bruno [Tue, 21 Dec 2021 14:08:48 +0000 (14:08 +0000)]
Merge pull request #2501 from lucab/ups/test-cli-extensions-tweak

tests/cli-extensions: tweak test logic

4 years agotests/cli-extensions: tweak test logic
Luca BRUNO [Tue, 21 Dec 2021 10:16:36 +0000 (10:16 +0000)]
tests/cli-extensions: tweak test logic

This updates the test logic for CLI extensions, actually checking
for functional output from the subcommand.
It also cleans up some environmental leftover.

4 years agoMerge pull request #2500 from lucab/ups/cli-extensions
Colin Walters [Mon, 20 Dec 2021 18:47:31 +0000 (13:47 -0500)]
Merge pull request #2500 from lucab/ups/cli-extensions

main: add support for CLI extensions via external binaries

4 years agomain: add support for CLI extensions via external binaries
Luca BRUNO [Mon, 20 Dec 2021 10:00:02 +0000 (10:00 +0000)]
main: add support for CLI extensions via external binaries

This adds some logic to detect and dispatch unknown subcommands to
extensions available in `$PATH`. Additional commands can be
implemented by adding relevant `ostree-$verb` binaries to the system.

As an example, if a `/usr/bin/ostree-extcommand` extension is provided,
the execution of `ostree extcommand --help` will be dispatched to that
as `ostree-extcommand extcommand --help`.

4 years agoMerge pull request #2498 from lucab/ups/test-assert-strings
Colin Walters [Fri, 10 Dec 2021 18:25:03 +0000 (13:25 -0500)]
Merge pull request #2498 from lucab/ups/test-assert-strings

tests: assert mandatory values are present

4 years agotests: assert mandatory values are present
Luca BRUNO [Fri, 10 Dec 2021 11:29:29 +0000 (11:29 +0000)]
tests: assert mandatory values are present

This adds a couple of string assertions to make sure that
the test run is sane.

4 years agoMerge pull request #2496 from lucab/ups/repo-asserts
Colin Walters [Wed, 8 Dec 2021 00:58:23 +0000 (19:58 -0500)]
Merge pull request #2496 from lucab/ups/repo-asserts

lib/repo: fix problematic invariant checks

4 years agoMerge pull request #2494 from jmarrero/fsf-address
Colin Walters [Tue, 7 Dec 2021 20:51:48 +0000 (15:51 -0500)]
Merge pull request #2494 from jmarrero/fsf-address

Update FSF license notices to use URL instead of address

4 years agolib/repo: do no return a NULL on failure
Luca BRUNO [Tue, 7 Dec 2021 16:20:49 +0000 (16:20 +0000)]
lib/repo: do no return a NULL on failure

This turns an existing check into an assert. The previously returned
NULL may result in confusing callers, as none of them is checking for
that.

4 years agolib/repo: do no return an arbitrary mode on failure
Luca BRUNO [Tue, 7 Dec 2021 16:16:39 +0000 (16:16 +0000)]
lib/repo: do no return an arbitrary mode on failure

This turns the existing check into an assert. Otherwise, the previous
code may return an arbitrary repo mode (bare) on failure.

4 years agolib/repo: assert that writable state and error agree
Luca BRUNO [Tue, 7 Dec 2021 16:13:54 +0000 (16:13 +0000)]
lib/repo: assert that writable state and error agree

This adds an assertion to check that writable stable and error
are in sync. The subsequent logic uses them interchangeably.

4 years agoUpdate FSF license notices to use URL instead of address
Joseph Marrero [Tue, 7 Dec 2021 01:20:55 +0000 (20:20 -0500)]
Update FSF license notices to use URL instead of address

4 years agoMerge pull request #2493 from cgwalters/summary-lock-shared
Colin Walters [Mon, 6 Dec 2021 13:19:12 +0000 (08:19 -0500)]
Merge pull request #2493 from cgwalters/summary-lock-shared

repo: Change locking for summary regeneration to be shared

4 years agorepo: Change locking for summary regeneration to be shared
Colin Walters [Fri, 3 Dec 2021 19:35:12 +0000 (14:35 -0500)]
repo: Change locking for summary regeneration to be shared

This is trying to address:
https://pagure.io/fedora-iot/issue/48

Basically we changed rpm-ostree to start doing a shared lock during
commit by default, but this broke because pungi is starting a process
doing a commit for each architecture, and then trying to regenerate
the summary after each one.

This patch is deleting a big comment with a rationale for why
summary regeneration should be exclusive.  Point by point:

> This makes sure the commits and deltas don't get
> deleted while generating the summary.

But prune operations require an exclusive lock, which means that
data still can't be deleted when the summary grabs a shared lock.

> It also means we can be sure refs
> won't be created/updated/deleted during the operation, without having to
> add exclusive locks to those operations which would prevent concurrent
> commits from working.

First: The status quo *has* prevented concurrent commits from working!

There is no real locking solution to this problem. What we really
need to do here is regenerate the summary after each commit *or*
when the caller decides to do it and e.g. include deltas at the same
time.

It's OK if multiple threads race to regenerate the summary;
last-one-wins behavior here is totally fine.

4 years agoMerge pull request #2490 from lucab/ups/static-fixes
Jonathan Lebon [Fri, 26 Nov 2021 15:55:15 +0000 (10:55 -0500)]
Merge pull request #2490 from lucab/ups/static-fixes

4 years agolib: misc static analysis fixes
Luca BRUNO [Thu, 25 Nov 2021 15:04:09 +0000 (15:04 +0000)]
lib: misc static analysis fixes

This fixes a few warnings from coverity, none of which really
interesting.

4 years agoMerge pull request #2489 from ostreedev/release-2021.6
Colin Walters [Tue, 23 Nov 2021 14:01:57 +0000 (09:01 -0500)]
Merge pull request #2489 from ostreedev/release-2021.6

Release 2021.6

4 years agoconfigure: post-release version bump
Luca BRUNO [Tue, 23 Nov 2021 10:15:19 +0000 (10:15 +0000)]
configure: post-release version bump

4 years agoRelease 2021.6
Luca BRUNO [Tue, 23 Nov 2021 10:13:32 +0000 (10:13 +0000)]
Release 2021.6

4 years agoMerge pull request #2486 from jlebon/pr/remount-ostree
Colin Walters [Mon, 22 Nov 2021 18:35:28 +0000 (13:35 -0500)]
Merge pull request #2486 from jlebon/pr/remount-ostree

app: Only remount /sysroot if needed

4 years agoapp: Only remount /sysroot if needed
Jonathan Lebon [Fri, 19 Nov 2021 15:44:03 +0000 (10:44 -0500)]
app: Only remount /sysroot if needed

We should only try to remount `/sysroot` if we're actually handling the
sysroot repo and the repo isn't writable. We already have public APIs to
check each of those, so let's use them.

Closes: #2485
4 years agoMerge pull request #2484 from dbnicholson/prune-serialize
Colin Walters [Thu, 18 Nov 2021 19:49:15 +0000 (14:49 -0500)]
Merge pull request #2484 from dbnicholson/prune-serialize

lib/prune: Avoid unnecessary object serialization

4 years agolib/prune: Avoid unnecessary object serialization
Dan Nicholson [Thu, 18 Nov 2021 17:59:46 +0000 (10:59 -0700)]
lib/prune: Avoid unnecessary object serialization

`repo_prune_internal` was deserializing each object and passing the
components to `maybe_prune_loose_object`, which promptly reserialized
it.

4 years agoMerge pull request #2481 from refi64/null-error
Luca Bruno [Fri, 12 Nov 2021 15:19:29 +0000 (15:19 +0000)]
Merge pull request #2481 from refi64/null-error

lib: Avoid dereferencing NULL error values

4 years agolib: Avoid dereferencing NULL error values
Ryan Gonzalez [Fri, 12 Nov 2021 00:07:06 +0000 (18:07 -0600)]
lib: Avoid dereferencing NULL error values

Otherwise, this will segfault when callers don't need any exact errors.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
4 years agoMerge pull request #2479 from cgwalters/ci-capsh
Colin Walters [Tue, 9 Nov 2021 15:44:08 +0000 (10:44 -0500)]
Merge pull request #2479 from cgwalters/ci-capsh

ci: Require `libcap2-bin` for `capsh`